<template>
  <div>
    <h1 v-bgred>蓝色</h1>
  </div>
</template>

<script>
export default {
  name:"App",
  directives:{
    bgred(ele){
      ele.style.background = "blue"
    }
  }
};
</script>

<style></style>
